<template>
    <a-select
            style="width:200px;"
            showSearch
            placeholder="所属系统"
            @change="handleCurrencyChange"
            allowClear
    >
        <a-select-option :value="sys.sysCode" v-for="sys in sysList">{{sys.sysName}}</a-select-option>
    </a-select>
</template>

<script>
  export default {
    name: 'sys-select',
    props: {
      sysCode: String
    },
    data () {
      return {
        sysList: [],
      }
    },
    created () {
      this.getSysList()
    },
    methods: {
      // 所属系统
      getSysList() {
        this.$axios.get('sysRest/getSysList').then(res => {
          this.sysList = res.data
        })
      },
      handleCurrencyChange (val) {
        this.$emit('change', val);
        this.$emit('update:sysCode', val)
      }
    }
  }
</script>